package com.atguigu.gmall.product.controller;

import com.atguigu.gmall.common.execption.GmallException;
import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.common.result.ResultCodeEnum;
import org.springframework.web.bind.annotation.*;

/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2024/9/9 1:14
 */
@RestController
@RequestMapping("/admin/product")
public class TestController {
    @GetMapping("/hello/{code}")
    public String hello(@PathVariable("code") Integer code){
        Integer i= 10/code;
        if (code % 2 == 1){
            throw new GmallException(ResultCodeEnum.COUPON_LIMIT_GET);
        }
        return "hello";
    }
}
